﻿// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
#pragma once

namespace Weathr
{
    // Constant buffer used to send MVP matrices to the vertex shader.
    struct ModelViewProjectionConstantBuffer
    {
        DirectX::XMFLOAT4X4 model;
        DirectX::XMFLOAT4X4 view;
        DirectX::XMFLOAT4X4 projection;
    };

    // Used to send per-vertex data to the vertex shader.
    struct VertexPositionColor
    {
        DirectX::XMFLOAT3 pos;
        DirectX::XMFLOAT3 color;
    };

    struct LightConstantBuffer
    {
        DirectX::XMFLOAT4 light; // vector towards light source, in world coordinates. w component not used.
    };

    // Similar to ModelViewProjectionConstantBuffer, but also contains the camera position.
    // Used to render the starfield.
    struct ModelViewProjectionCameraConstantBuffer
    {
        DirectX::XMFLOAT4X4 model;
        DirectX::XMFLOAT4X4 view;
        DirectX::XMFLOAT4X4 projection;
        DirectX::XMFLOAT3 camera;

        float pad; // byte width must be a multiple of 16
    };

    struct CloudParametersConstantBuffer
    {
        DirectX::XMFLOAT4 centerNormal;  // w component not used
        DirectX::XMFLOAT4 move;          // z, w components not used
        float speed;
        float overcast;
        float colorFactor;

        float pad; // byte width must be a multiple of 16
    };
}